﻿create proc thuan_qtdanhmucvitrimenusua  
@ID int,  
@DienGiai nvarchar(255)  
as  
if exists(select * from DanhMuc_ViTriMenu  Where IDViTri<>@ID and DienGiai=@DienGiai)  
begin  
select ErrCode=0  
end  
else  
begin  
update DanhMuc_ViTriMenu  set DienGiai=@DienGiai WHere IDViTri=@ID  
select ErrCode=1  
end